import uity.getConnect;

import java.sql.*;

public class sesstudent {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Connection conn = getConnect.getConnect();
        // 创建stmt对象
        Statement stmt = conn.createStatement();

        String select = "select * from students";
        ResultSet rs = stmt.executeQuery(select);
        // 返回结果
//            if (rs.next()) {
        while (rs.next()) {
            int stuId = rs.getInt("s_id");
            String name = rs.getString("s_name");
            System.out.println(stuId + "\t" + name);
        }

    }
}
